package org.datascooter.utils.policy;

public enum Function {
	NONE, AVG, COUNT, SUM, MAX, MIN;

	@SuppressWarnings("nls")
	public static String toString(Function function, String field) {
		if (function == null) {
			return "";
		}
		if (field == null || field.equals("")) {
			field = "*";
		}
		switch (function) {
			case AVG:
				return "AVG( " + field + " )";
			case COUNT:
				return "COUNT( " + field + " )";
			case SUM:
				return "SUM( " + field + " )";
			case MAX:
				return "MAX( " + field + " )";
			case MIN:
				return "MIN( " + field + " )";
		}
		return "";
	}
}
